using System;
using System.Collections.Generic;
using Core.GameObjects.Entities;
using Core.GameObjects.Items;

namespace Core.GameObjects.Nen
{
    public enum SpellCastRate
    {
        None = -1,             //No restrictions
        Round,           //Once per round of combat
        Minute,
        Hour,
        Day,
        Week,
        Month
    }

    public class NenAction
    {
        public string Name { get; protected set; }
        public string Description { get; protected set; }
        public string EffectAmount { get; protected set; }
        public string Range { get; protected set; }
        public List<int> ClassesRequired { get; protected set; }
        public string Duration { get; protected set; }
        public byte LevelRequired { get; protected set; }
        public short ManaCost { get; protected set; }
        public SpellCastRate CastRate { get; protected set; }
        public List<Bonus> DefBonuses { get; protected set; }
        public List<Bonus> OffBonuses { get; protected set; }
        public List<Bonus> MiscBonuses { get; protected set; }

        public bool Cast(ref Object target, ref Entity caster)
        {
            return true;
        }

        public bool Cast(ref Entity target, ref Entity caster)
        {
            //short mr = target.MagicResistance;
            //short roll = GlobalFunctions.GetRandomNumber(DieType.d100);

            ////Get caster's skill bonus
            //roll += (short)caster.GetCastingSkillBonus();

            ////resistance not applicable for any but offensive spells
            //if (_type == SpellType.Offensive)
            //    roll -= mr;

            //if (roll >= 100)
            //{
            //    switch (_type)
            //    {
            //        case SpellType.BuffAny:
            //        case SpellType.BuffSelf:
            //            {

            //                break;
            //            }
            //        case SpellType.Defensive:
            //            {

            //                break;
            //            }

            //        case SpellType.Miscellaneous:
            //            {

            //                break;
            //            }

            //        case SpellType.NonCombat:
            //            {

            //                break;
            //            }

            //        case SpellType.Offensive:
            //            {
            //                target.Damage((int)GlobalFunctions.GetRangeAmount(_effectAmount), DamageType.Magical);

            //                break;
            //            }

            //    }

            //    return true;
            //}

            return false;
        }
    }
}